<?php
class StoreUseViewModel extends ViewModel{
	public $table ='store';
	public $view = array(
         'store'=>array(
            'type' => 'INNER'
         	),
          'attr'=>array(
             'on'=>'__attr__.sid=__store__.sid',
             'type'=>'INNER'
         	),
	);
    // 获得所有数据
	public function get_data(){
		return $this->all();
	}
	// 获得一条数据
	public function get_one_data($where = NULL){
		return $this->where($where)->find();
	}
	// 增加
	public function add_data($data=NULL){
		return $this->add($data);
	}
    // 删除
	public function dele($where=NULL){
		return $this->where($where)->delete();
	}
	// 更新
	public function update_data($where=NULL,$data=NULL){
       return $this->where($where)->update($data);
    }
}